import config from "@/config"
import http from "@/utils/request"
import { objectToFormData } from "@/utils/formDataFormat";

export default {
	sysMarketList: {
		url: `${config.API_URL}/sysMarket/list`,
		name: "商场基本信息查询所有",
		get: async function (data = {}) {
			return await http.get(this.url, data);
		}
	},
	sysMarketPut: {
		url: `${config.API_URL}/sysMarket/update`,
		name: "商场基本信息修改",
		put: async function (data = {}) {
			return await http.put(this.url, objectToFormData(data));
		}
	},
	sysMarketPost: {
		url: `${config.API_URL}/sysMarket/insert`,
		name: "商场基本信息添加",
		post: async function (data = {}) {
			return await http.post(this.url, objectToFormData(data));
		}
	},
	sysMarketDelete: {
		url: `${config.API_URL}/sysMarket/delete`,
		name: "商场基本信息删除",
		delete: async function (data = {}) {
			return await http.delete(this.url, objectToFormData(data));
		}
	},
	sysFloorList: {
		url: `${config.API_URL}/sysFloor/list`,
		name: "楼层基本信息查询所有",
		get: async function (data = {}) {
			return await http.get(this.url, data);
		}
	},
	sysFloorPost: {
		url: `${config.API_URL}/sysFloor/insert`,
		name: "楼层基本信息添加",
		post: async function (data = {}) {
			return await http.post(this.url, objectToFormData(data));
		}
	},
	sysFloorDelete: {
		url: `${config.API_URL}/sysFloor/delete`,
		name: "楼层基本信息删除",
		delete: async function (data = {}) {
			return await http.delete(this.url, objectToFormData(data));
		}
	},
	sysFloorPut: {
		url: `${config.API_URL}/sysFloor/update`,
		name: "楼层基本信息修改",
		put: async function (data = {}) {
			return await http.put(this.url, objectToFormData(data));
		}
	},
	sysGateList: {
		url: `${config.API_URL}/sysGate/list`,
		name: "出入口基本信息查询所有",
		get: async function (data = {}) {
			return await http.get(this.url, data);
		}
	},
	sysGatePost: {
		url: `${config.API_URL}/sysGate/insert`,
		name: "出入口基本信息添加",
		post: async function (data = {}) {
			return await http.post(this.url, objectToFormData(data));
		}
	},
	sysGateDelete: {
		url: `${config.API_URL}/sysGate/delete`,
		name: "出入口基本信息删除",
		delete: async function (data = {}) {
			return await http.delete(this.url, objectToFormData(data));
		}
	},
	sysGatePut: {
		url: `${config.API_URL}/sysGate/update`,
		name: "出入口基本信息修改",
		put: async function (data = {}) {
			return await http.put(this.url, objectToFormData(data));
		}
	},
	sysStoreList: {
		url: `${config.API_URL}/sysStore/list`,
		name: "店铺基本信息查询所有",
		get: async function (data = {}) {
			return await http.get(this.url, data);
		}
	},
	sysStorePost: {
		url: `${config.API_URL}/sysStore/insert`,
		name: "店铺基本信息添加",
		post: async function (data = {}) {
			return await http.post(this.url, objectToFormData(data));
		}
	},
	sysStoreDelete: {
		url: `${config.API_URL}/sysStore/delete`,
		name: "店铺基本信息删除",
		delete: async function (data = {}) {
			return await http.delete(this.url, objectToFormData(data));
		}
	},
	sysStorePut: {
		url: `${config.API_URL}/sysStore/update`,
		name: "店铺基本信息修改",
		put: async function (data = {}) {
			return await http.put(this.url, objectToFormData(data));
		}
	},
	sysCameraList: {
		url: `${config.API_URL}/sysCamera/list`,
		name: "摄像头基本信息查询所有",
		get: async function (data = {}) {
			return await http.get(this.url, data);
		}
	},
	sysCameraPost: {
		url: `${config.API_URL}/sysCamera/insert`,
		name: "摄像头基本信息添加",
		post: async function (data = {}) {
			return await http.post(this.url, objectToFormData(data));
		}
	},
	sysCameraDelete: {
		url: `${config.API_URL}/sysCamera/delete`,
		name: "摄像头基本信息删除",
		delete: async function (data = {}) {
			return await http.delete(this.url, objectToFormData(data));
		}
	},
	sysCameraPut: {
		url: `${config.API_URL}/sysCamera/update`,
		name: "摄像头基本信息修改",
		put: async function (data = {}) {
			return await http.put(this.url, objectToFormData(data));
		}
	},
}
